package com.huang.mylibrary.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.huang.mylibrary.bean.UserInfo;
import com.huang.mylibrary.bean.ImageListInfo;

import com.huang.mylibrary.dao.UserInfoDao;
import com.huang.mylibrary.dao.ImageListInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig userInfoDaoConfig;
    private final DaoConfig imageListInfoDaoConfig;

    private final UserInfoDao userInfoDao;
    private final ImageListInfoDao imageListInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        userInfoDaoConfig = daoConfigMap.get(UserInfoDao.class).clone();
        userInfoDaoConfig.initIdentityScope(type);

        imageListInfoDaoConfig = daoConfigMap.get(ImageListInfoDao.class).clone();
        imageListInfoDaoConfig.initIdentityScope(type);

        userInfoDao = new UserInfoDao(userInfoDaoConfig, this);
        imageListInfoDao = new ImageListInfoDao(imageListInfoDaoConfig, this);

        registerDao(UserInfo.class, userInfoDao);
        registerDao(ImageListInfo.class, imageListInfoDao);
    }
    
    public void clear() {
        userInfoDaoConfig.clearIdentityScope();
        imageListInfoDaoConfig.clearIdentityScope();
    }

    public UserInfoDao getUserInfoDao() {
        return userInfoDao;
    }

    public ImageListInfoDao getImageListInfoDao() {
        return imageListInfoDao;
    }

}
